package com.xnyzc.lhy.order.common.userenum;

import com.xnyzc.lhy.common.exception.PangException;
import com.xnyzc.lhy.common.penum.EErrorCode;
import com.xnyzc.lhy.common.util.CheckUtil;

public enum EAccountStatus {

    /**
     * 身份证状态
     */
    OK(0, "正常"),
    WAIT_COMMIT(1, "待提交"),
    WAIT_APPLY(2, "待审核"),
    APPLY_FILED(3, "审核驳回"),
    NO_LEF(4, "未激活"),
    LOGON_ERR(5, "封号中");


    private Integer key;
    private String value;

    EAccountStatus(Integer key, String value) {
        this.key = key;
        this.value = value;
    }

    public static String value(Integer key) {
        if (CheckUtil.objIsNotEmpty(key)) {
            for (EAccountStatus examine : EAccountStatus.values()) {
                if (key.equals(examine.getKey())) {
                    return examine.getValue();
                }
            }
        }
        throw PangException.create(EErrorCode.noData);
    }

    public Integer getKey() {
        return key;
    }

    public String getValue() {
        return value;
    }

}
